package com.mj.priqueue;

/**
 * @Author: LDeng
 * @Date: 2021-03-19 10:17
 */
public class Main {

    public static void main(String[] args) {
        PriorityQueue<Person> queue=new PriorityQueue<>();
        queue.enQueue(new Person("Jack",18));
        queue.enQueue(new Person("Rose",20));
        queue.enQueue(new Person("Mary",30));
        queue.enQueue(new Person("Tom",40));


        while (!queue.isEmpty()){
            Person person = queue.deQueue();
            System.out.println(person);
        }
    }

    //java.util.PriorityQueue
}
